<?php


namespace app\admin\controller;
use think\Db;
use think\Request;
use think\Controller;
class Exwork extends ApiCommon
{
    public function ExworkWrite()
    {
        $newsModel=model('Exwork');
        $param=$this->param;
        $data=$newsModel->WriteExwork($param);
        if(!$data)
        {
            return resultArray(['error'=>'添加数据失败']);
        }
        return resultArray(['data'=>'添加数据成功']);
    }   

    public function ExworkList()
    {
        $newsModel=model('Exwork');
        $param=$this->param;
        $data=$newsModel->ListExwork($param);
        return resultArray(['data'=> $data]);
    }   
    public function ExworkRevise()
    {
        $newsModel=model('Exwork');
        $param=$this->param;
        $data=$newsModel->ReviseExwork($param);
        if(!$data)
        {
            return resultArray(['error'=>'修改数据失败']);
        }
        return resultArray(['data'=>'修改数据成功']);
    }
     public function ExworkDelete()
    {
        $newsModel=model('Exwork');
        $param=$this->param;
        $data=$newsModel->DeleteExwork($param);
        if(!$data)
        {
            return resultArray(['error'=>'删除数据失败']);
        }
        return resultArray(['data'=>'删除数据成功']);
    }
}